var http = require('http');
var url = require('url');
var model=require('./model/model');
var server = http.createServer(function (req, res) {
    res.writeHead(200, {
        'Type-Content': 'text/html;charset=utf-8;'
    });
    var pathname=url.parse(req.url).pathname.replace('/','');
    try{
        if(pathname!='favicon.ico'){
            model[pathname](req,res);
        }
    }catch(err){
        model['index'](req,res);
    }
    
});
server.listen(8100);